package com.itheima.service.impl;


import com.aliyun.AliyunOSSOperator;
import com.itheima.service.UploadService;
// import com.itheima.utils.AliyunOSSOperator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@Service
public class UploadServiceImpl implements UploadService {

    @Autowired
    private AliyunOSSOperator aliyunOSSOperator;

    @Override
    public String upload(MultipartFile file) throws Exception {

        String upload = aliyunOSSOperator.upload(file.getBytes(), String.valueOf(file));

        return upload;
    }
}
